As described in JP Laid-Open Patent Application No. 2008-129749, a conventional image forming apparatus and an image forming system accumulate image data after performing printing, facsimile transmission, or the like, and judges whether a restriction message is contained in the image data. If no restriction message is contained, the image data is registered to the search index, and if a restriction message is contained, the image data is not registered to the search index. Therefore, even if a user executes a search, image data containing a restriction message cannot be accessed. Accordingly, confidential information is prevented from being leaked.
However, in the conventional image forming apparatus and image forming system, although the presence of restriction message is judged for accumulated image data, the presence of a restriction message is not judged before forming the image. Therefore, there are cases where confidential information leaked.